var serviceCtrl  = new XFApp.client();

XFApp.client.prototype.service = {
		successCode : 10000,		
		urlItems : {			
			redirectURL: basePath+"/services/redirectURL?type=",			
		},
		
		event : function (){			
			_this = this;			
									
		},	
		
		userCheck : function (val) {			
			//已登录直接跳转至菜单页面，否则跳转至登录页面
			if(val == '1'){
				if(registerType == '1'){
					if(loginState == '1'){
						//window.location.href = basePath + "/main" ;						
						$("#divId").attr("href", _this.urlItems.redirectURL+val);
						
					}else{
						window.location.href = basePath + "/login/index" ;
					}
				}else{
					window.location.href = basePath + "/login/index" ;
				}				
			}
			else if(val == '2'){
				if(registerType == '2'){
					if(loginState == '1'){
						//window.location.href = basePath + "/main" ;
						$("#divId").attr("href", _this.urlItems.redirectURL+val);
					}else{
						window.location.href = basePath + "/login/index" ;
					}
				}else{
					window.location.href = basePath + "/login/index" ;
				}
			}else if(val == '3'){
				if(registerType == '1' || registerType == '2'){
					if(loginState == '1'){
						//window.location.href = basePath + "/main" ;
						$("#divId").attr("href", _this.urlItems.redirectURL+val);
					}else{
						window.location.href = basePath + "/login/index" ;
					}
				}else{
					window.location.href = basePath + "/login/index" ;
				}
				
			}else{
				window.location.href = basePath + "/login/index" ;
			}			
		},
},

$(function(){	
	serviceCtrl.service.event();
	
});